import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    //设置域名
    host: '127.0.0.1',
    port: 8080,
    //配置代理跨域
    proxy: {
      '/apis': {
        target: 'https://www.dance365.com/',
        changeOrigin: true,
        secure:true,
        // rewrite: (path) => path.replace(/^\/api/, '')
      },
      '/api':{
        target:'http://sph-h5-api.atguigu.cn',
       
      }
    }
  },
  resolve: {
    alias: {
      '@': resolve(__dirname, "src"),
    },
    extensions: [".ts", ".vue", ".js", ".jsx", ".tsx"], // 导入时想要省略的扩展名列表。
  },
})
